package university;


import university.exceptions.InvalidBuildingException;
import university.exceptions.InvalidDateException;
import university.exceptions.InvalidLessonNumberException;
import university.exceptions.InvalidRoomException;

import java.util.*;

/**
 * Created by anatolii.bondarenko on 2/18/14.
 */
class LessonEvent {
    private int dayOfWeek;
    private int lessonNumber;
    private int building;
    private int room;
    public LessonEvent(int d, int l, int b, int r) throws InvalidDateException, InvalidLessonNumberException, InvalidRoomException, InvalidBuildingException{
        dayOfWeek = d;
        lessonNumber = l;
        building = b;
        room = r;
        if (d > Calendar.SATURDAY || d < Calendar.MONDAY){
            throw new InvalidDateException("Invalid Day. Must be from Monday to Saturday(from 2 to 7)");
        }
        if (l < 1 || l > 6){
            throw new InvalidLessonNumberException("Invalid Lesson Number. Must be from 1 to 6");
        }
        if (b < 1){
            throw new InvalidBuildingException("Building Number must be positive Integer");
        }
        if (r < 1){
            throw new InvalidRoomException("Room Number must be positive integer");
        }
    }

    public int getDayOfWeek(){
        return dayOfWeek;
    }

    public int getLessonNumber(){
        return lessonNumber;
    }

    public int getBuilding(){
        return building;
    }

    public int getRoom(){
        return room;
    }
}
